<?php $this->load->view('common/ck-bosspagehead'); ?>
<?php $this->load->view('common/ck-bossheader'); ?>
<article id="content">
    <div class="pgwrapper">
    <div class="w960 bg1 p15 bx_shw">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="20%" style="border-right: 2px solid #e5e5e5;" valign="top">
			<?php $this->load->view('enterprises/leftnavCMS'); ?>
			</td>
			<td width="80%" valign="top"><form enctype="multipart/form-data"
					action="/addOccasion" onsubmit="return validateForm()" method="POST">
					<table width="100%" border="0" cellpadding="5" cellspacing="0"
						style="padding-left: 20px;">
						<tr>
							<td class="txt-blck" width="30%">Occasion Name:</td>
							<td width="70%"><input type="text" onblur="makeURLOccasion(this)" value="" name="occasion_name"
								id="occasion_name" class="inputCMS" style="width: 300px;" />
							</td>
						</tr>
						<tr>
							<td class="txt-blck" width="30%">Occasion Url:</td>
							<td width="70%"><input type="text" value="" name="occasion_url"
								id="occasion_url" class="inputCMS" style="width: 300px;" />
							</td>
						</tr>
						<tr>
							<td class="txt-blck">Occasion Status:</td>
							<td><select id="occasion_status" name="occasion_status">
									<option value="Yes">Yes</option>
									<option value="No">No</option>
							</select></td>
						</tr>
						<tr>
							<td valign="top" class="txt-blck">Occasion Description:</td>
							<td><textarea style="width: 450px; height: 300px;" class="input"
									id="occasion_description" name="occasion_description"></textarea></td>
						</tr>
						<tr>
							<td class="txt-blck" width="30%"></td>
							<td width="70%">
								<input type="checkbox" name="editBanner" id="editBanner" value="1"
									onclick="addBannerOption();" /> Add Banner
							</td>
						</tr>
						<tr>
							<td class="txt-blck" width="30%">Occasion Banner:</td>
							<td width="70%"><input type="text" value="" name="occasion_banner"
								id="occasion_banner" readonly="readonly" class="inputCMS" style="width: 300px;" />
							</td>
						</tr>
						<tr>
							<td class="txt-blck" width="30%">Occasion Banner Link:</td>
							<td width="70%"><input type="text" value="" name="occasion_banner_link"
								id="occasion_banner_link" readonly="readonly" class="inputCMS" style="width: 300px;" />
							</td>
						</tr>
						<tr>
							<td></td>
							<td><input type="submit" name="occasion_submit" value="Submit" /></td>
						</tr>
					</table>
				</form></td>
		</tr>
	</table>
</div>
</div>
</article>
<div class="clr-both spacer-10">&nbsp;</div>
<?php $this->load->view('common/ck-bossfooter'); ?>
<script>
function makeURLOccasion(obj){
	var str = obj.value;
	str1 = str.toLowerCase();
	str2 = str1.replace(/ /g,"-");
	document.getElementById('occasion_url').value = str2;
}

function validateForm(){
	var x = document.getElementById('occasion_name').value;
	if(x==""){
	alert("Occasion Name must be filled out.");
	return false;
	}
}

function addBannerOption(){
	if(document.getElementById('editBanner').checked){
		document.getElementById('occasion_banner').removeAttribute('readonly');
		document.getElementById('occasion_banner_link').removeAttribute('readonly');
	}else{
		document.getElementById('occasion_banner').setAttribute('readonly', 'readonly');
		document.getElementById('occasion_banner_link').setAttribute('readonly', 'readonly');
	}
}
</script>